package com.dream.style.app.fr;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.dream.style.R;
import com.dream.style.app.ac.main.KztActivity;
import com.dream.style.app.ac.home.GoodMagActivity;

/**
 * @Created by lincyu
 * @Time: 2018/11/15 16:40
 * @Decs: 类：首页
 */
public class HomeFragment extends Fragment {

    static HomeFragment homeFragment;
    public static HomeFragment newInstance(){
        if (homeFragment !=null){
            return homeFragment;
        }
        homeFragment = new HomeFragment();
        return homeFragment;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }


    /** 商品管理*/
    private ImageView iv_goodMag;
    /** 紅包管理*/
    private ImageView iv_rbaoMag;
    /** 直播管理*/
    private ImageView iv_zhiboMag;
    /** 售后管理*/
    private ImageView iv_shouMag;
    /** 运费管理*/
    private ImageView iv_yfeiMag;
    /** 店铺管理*/
    private ImageView iv_dianMag;

    @Nullable
    @Override
    public View onCreateView(
            @NonNull LayoutInflater inflater,
            @Nullable ViewGroup container,
            @Nullable Bundle savedInstanceState)
    {
       View v =  inflater.inflate(R.layout.frag_home, container, false);

        iv_goodMag = v.findViewById(R.id.iv_goodMag);
        iv_goodMag.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            KztActivity ac = (KztActivity) getActivity();
            ac.start(GoodMagActivity.class);
        }
    });


        return v;
    }


}
